{% extends "oj_base.html" %}
{% block title %}
    用户注册
{% endblock %}
{% block body %}
    <div class="container main">
        <div class="col-md-6 col-md-offset-3">
            <h2 class="text-center">用户注册</h2>

            <form id="register-form">
                <div class="form-group">
                    <label for="username">用户名</label>
                    <input type="text" class="form-control input-lg" id="username" name="username" placeholder="用户名" data-remote="/api/username_check/" data-remote-error="该用户名已被注册！" data-error="请填写用户名" required autofocus>
                    <div class="help-block with-errors"></div>
                </div>
                <div class="form-group">
                    <label for="real_name">真实姓名</label>
                    <input type="text" class="form-control input-lg" id="real_name" name="real_name" placeholder="真实姓名" data-error="请填写姓名" required>
                    <div class="help-block with-errors"></div>
                </div>
                <div class="form-group">
                    <label for="school">学校</label>
                    <input type="text" class="form-control input-lg" id="school" name="school" placeholder="非必填，如果你需要使用课程功能，请填写该字段">
                </div>
                <div class="form-group">
                    <label for="student_id">学号</label>
                    <input type="number" class="form-control input-lg" id="student_id" name="student_id" placeholder="非必填，如果你需要使用课程功能，请填写该字段">
                </div>
                <div class="form-group">
                    <label for="email">邮箱地址</label>
                    <input type="email" class="form-control input-lg" id="email" name="email" placeholder="邮箱地址" data-remote="/api/email_check/" data-remote-error="该邮箱已被注册！" data-error="请填写正确的邮箱地址" required>
                    <div class="help-block with-errors"></div>
                </div>
                <div class="form-group">
                    <label for="password">密码</label>
                    <input type="password" class="form-control input-lg" id="password" name="password" data-error="请填写密码" placeholder="密码" data-minlength="6" data-minlength-error="密码不得少于6位" required>
                    <div class="help-block with-errors"></div>
                </div>
                <div class="form-group">
                    <label for="confirm_password">确认密码</label>
                    <input type="password" class="form-control input-lg" id="confirm_password" name="confirm_password"
                           placeholder="确认密码" data-match="#password" data-match-error="两个密码不一致" data-error="请填写确认密码" required>
                    <div class="help-block with-errors"></div>
                </div>
                <div class="form-group">
                    <label for="captcha">验证码</label>
                    &nbsp;&nbsp;<img src="/captcha/" id="captcha-img"><small><p></p></small>
                    <input type="text" class="form-control input-lg" id="captcha" name="captcha" placeholder="验证码" maxlength="4" data-error="请填写验证码" required>
                    <div class="help-block with-errors"></div>
                </div>
                <div class="form-group">
                    <button type="submit" class="btn btn-primary">提交</button>
                </div>
            </form>
        </div>
    </div>
{% endblock %}
{% block js_block %}
    <script src="/static/js/app/oj/account/register.js"></script>
{% endblock %}